import ApiResult from "@/api/base/ApiResult";
import {request, post} from "@/utils/request";
import {
    ICopyModelData,
    ICreateModelData,
    IDeleteModelData,
    IGetFlowModelListData,
    IGetModelData, IMarketingModelData, ITradeDelTradeData, ITradeEntityData, ITradeSaveUpdateData,
    IUpdateModelData
} from "@/api/modules/flow";

/**
 * 营销模型分页列表
 * @param data
 */
export async function getFlowModelList(data: IGetFlowModelListData) {
    const rs: ApiResult<any>  = await request('flow/canvasTemplate/pageList', data)
    return rs

}

export async function deleteFlowModel(data: IDeleteModelData) {
    const rs: ApiResult<any> = await request('backstage/flow/del', data)
    return rs
}

export async function copyFlowModel(data: ICopyModelData) {
    const rs: ApiResult<any> = await request('backstage/flow/copy', data)
    return rs
}

export async function getModelData(data: IGetModelData) {
    const rs:ApiResult<any> = await request('backstage/flow/getInfo', data)
    return rs
}

export async function backstageTradeEntity (data: ITradeEntityData) {
    const rs:ApiResult<any> = await request('backstage/backstageTradeEntity/pageList', data)
    return rs
}

export async function getMarketingModel (data: IMarketingModelData) {
    const rs:ApiResult<any> = await request('backstage/flow/saasMarketingJourneyInfoEntity/pageList', data)
    return rs
}

export async function getMarketingStrategy (data: IMarketingModelData) {
    const rs:ApiResult<any> = await request('backstage/flow/marketingJourneyStrategyEntity/pageList', data)
    return rs
}

/**
 * 保存或更新行业
 * @param data
 */
export async function saveOrUpdateTrade (data: ITradeSaveUpdateData) {
    const rs:ApiResult<any> = await request('backstage/backstageTradeEntity/saveOrUpdate', data)
    return rs
}

/**
 * 保存或更新行业
 * @param data
 */
export async function deleteTrade (data: ITradeDelTradeData) {
    const rs:ApiResult<any> = await request('backstage/backstageTradeEntity/del', data)
    return rs
}


